package library.mapper;

import library.po.BookType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BookTypeMapper {
    /**
     * delete by primary key
     * @param bookTypeId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer bookTypeId);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(BookType record);

    /**
     * select by primary key
     * @param bookTypeId primary key
     * @return object by primary key
     */
    BookType selectByPrimaryKey(Integer bookTypeId);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(BookType record);
    /**
     * 查询所有图书类型
     * @return typeList
     */
    List<BookType> selectAllBookType();

    /**
     * 通过图书类型名找图书类型
     * @param name
     * @return
     */
    BookType selectByTypeName(String name);
}